// bool, Obj this, Obj other

Unit me;
Building bld;
Settlement sett;

me = this.AsUnit();
if(!me.IsValid()) return false;
bld = other.AsBuilding();
if(!bld.IsValid()) return false;
if(!bld.IsCentralBuliding()) return false;

if(bld.IsHeirOf("Catapult"))
	if(!me.IsHeirOf("Military")) return false;

if(bld.IsHeirOf("TTent")) return false;
if(bld.IsHeirOf("GreatTavern")) return false;
if(me.IsHeirOf("RamUnit")) return false;
if(me.IsHeirOf("Wagon")) return false;
if(me.IsHeirOf("Sentry")) return false;
if(me.IsHeirOf("BaseAnimal")) return false;
sett = bld.settlement;
if(!sett.IsValid()) return false;
if(sett.max_units==0) return false;
if(sett.max_units==sett.UnitsCount) return false;
if(!DiplGetShareView(bld.player, me.player)) return false;
if(me.IsHeirOf("ShipBattle")) return bld.IsHeirOf("BaseShipyard");

return true;
